<template>
  <div>
    <div style="height:20px;"></div>
    <FormPanel ref="from" :list="formList" @formChange="changeHandle" :isSubmitBtn="false" :collapse="false" labelWidth="110" />



  </div>
</template>
<script>
export default {
  data(){
    return{
      formList:this.createdFrom(),

    }
  },
  watch:{
    'data':{
      handler(newName,oldName){
        this.getDetail(newName)
      },
      deep:true
    }
  },
  props:['data'],
  components:{
  },
  mounted(){
    this.getDetail(this.data)
  },
  methods:{
    createdFrom(){
      return [
        {
          type: 'BREAK_SPACE',
          label: '其他附件上传2:身份证,营业执照,合同,发票,完税证明,保单,车辆登记证书,行驶证',
        },
       {
          type: 'UPLOAD_FILE',
          label: '其他附件',
          fieldName: 'qtfj',
          placeholder: '请选择',
          disabled:true,
          selfCols:2,
          initialValue:[]
        },
      ]
    },
    seacherFun(){
      this.issearch=true;
    },
    changeHandle(val){

    },
    getDetail(data){
      console.log(data,'data')
      for (let i in data) {
      this.formList.map(x => {
          if(x.fieldName=='qtfj'){
            let arr=[]
            data.enclosures.map(y=>{
              if(y.enclosureType=='otherAddress'){
                arr.push({name:y.enclosureName,url:y.enclosureUrl})
              }
            })
            x.initialValue=arr;
          }

        });
      }

    },

  }
}
</script>
